package xc.com.cms.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xc.com.cms.domain.CmsConfig;
import xc.com.cms.repositor.CmsConfigRepository;
import xc.com.cms.service.CmsConfigService;

import java.util.Optional;
@Service
public class CmsConfigServiceImpl implements CmsConfigService  {

    @Autowired
    private CmsConfigRepository cmsConfigRepository;
    @Override
    public CmsConfig getConfigById(String id) {
        Optional<CmsConfig> cmsConfig = cmsConfigRepository.findById(id);
        if(cmsConfig.isPresent()){
            CmsConfig config = cmsConfig.get();
            return config;
        }
        return null;
    }
}
